package com.heihei.mymusic.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 封装分页类
 */
public class PaginationInfo<T> implements Serializable {

	private static final long serialVersionUID = 1L;
	/** 总记录数 */
	private long total;
	/** 结果集 */
	private List<T> records;

	public PaginationInfo() {
		super();
		this.total = 0L;
		this.records = Collections.emptyList();
	}

	public PaginationInfo(long totalRecordCount, List<T> records) {
		super();
		this.total = totalRecordCount;
		this.records = records;
	}

	/** 无数据 */
	public static PaginationInfo<Object> emptyResult() {
		return new PaginationInfo<Object>(0, new ArrayList<Object>());
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public List<T> getRecords() {
		return records;
	}

	public void setRecords(List<T> records) {
		this.records = records;
	}

}